home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
aeclipd.arc
/
AEDIAL.DOC
< prev
next >
Wrap
Text File
|
1989-10-14
|
7KB
|
187 lines
Brought to You By:
──────────────────────────────────────────────────────────────────────────────
╔╦════╦╗ ╔╗ ╔╗ ╔╦═╦╦═╦╗ ╔╦════╦╗ ╔╦════╦╗ ╔╗ ╔╗ ╔╦════╦╗ ╔╦════╦╗
║║ ║║ ║║ ║║ ╚╝ ║║ ╚╝ ║║ ║║ ║║ ╚╝ ╚╩╗ ╔╩╝ ║║ ╚╝ ║║ ╚╝
║╠════╣║ ║║ ║║ ║║ ║║ ║║ ║╠═══╣ ╔╩══╩╗ ║╠═══╣ ║║
║║ ║║ ║║ ║║ ║║ ║║ ║║ ║║ ╔╗ ╔╣ ╠╗ ║║ ╔╗ ║║ ╔╗
╚╝ ╚╝ ╚╩════╩╝ ╚╝ ╚╩════╩╝ ╚╩════╩╝ ╚╝ ╚╝ ╚╩════╩╝ ╚╩════╩╝
──────────────────────────────────────────────────────────────────────────────
Auto Exec BBS (508) 833-0508 & (508) 833-0509 - 300-19,200 HST
1 GIGABYTE On-Line (508)833-0510 - MicroCom QX/V.32c, 300-38,400 V.32
« « « « « » » » » » Only Reg Reqd to D/L up to 450,000 bytes per day
──────────────────────────────────────────────────────────────────────────────
SysOps: Milton Shaw & Gene Lafond Home of AECLIP Clipper 'C' Libraries
──────────────────────────────────────────────────────────────────────────────
Specializing in Clipper/dBASE/FoxBase, 'C', Pascal, Novell, Games, Adult & Mac
──────────────────────────────────────────────────────────────────────────────
AEDIAL.LIB
Author: Milton F. Shaw Jr.
Copyright: Auto Exec Inc., (c) Copyright 1989, ALL RIGHTS RESERVED
Date: October 12, 1989
Purpose: 'C' Function to Dial Hayes Compatible Modem from Clipper S87
Restrictions: None - Post Public Domain as long as files contained in ZIP
format and only the files listed below:
AECLIPD.PRG - Linkable Program to test aedial.lib
AEDIAL.LIB - Library of Functions
AEDIAL.C - 'C' Source
AEDIAL.DOC - This Document
AEDIAL.LST - Map of OBJ
READIT.COM - Auto Exec BBS Ad
Why AEDIAL?
Just thought I'd show how I approach making 'C' functions work with Clipper
since I am not a serious 'C' programmer. This shows anyone can make 'C'
functions that will work with Clipper. Any serious 'C' programmer would look
at the code in agony. Oh Well!
Why 'C' Functions - Basically because Clipper, as good as it is, lacks special
functions we often need. Granted you can buy libraries that will give you
most functions you could ever want. Auto Exec has shareware libraries for
the following:
Graphics - Large Graphic library for Clipper - AECLIPT.ZIP
Math - 48 Mathematic functions for Clipper - AECLIPM.ZIP
Indexes - Convert NDX, IDX, MDX to NTX - AECLIPI.ZIP
DOS - Many DOS functions - MD, CD, RD etc - AECLIP.ZIP
STRINGS - String Functions - AECLIPS.ZIP
But back to the subject at hand. I wanted to provide a quick dialer for my
clients programs - Well I could use SilverCom, or Clipper Tools One which
I have both of. Then I thought, how hard is it to write a simple little 'C'
function to dial a modem.
Time to get out the "Waite Groups MicroSoft C Bible" and "Microsoft C
Programming for the IBM" - two excellent books put out by Howard Sams
& Company.
A little investigation and you find that there are 'C' commands to address
the comm ports. Great - now we've got it.
To make a 'C' function I generally look through my library of books, find
working code for a program that does what I want, make it work in 'C', and
then modify it for Clipper.
How do you modify it. Well basically the only thing you need to do is to
change the MAIN() procedure to CLIPPER <your function name>(). Keep the
function name 10 characters or less.
Now add to the include list:
#include "EXTEND.H"
I use the QuickC compile command with a Syntax Check only to make sure I'm
ok. Then you need to save the code and complile it as a large model.
Microsoft 'C' compiling batch file would look like:
cl/c /AL /F 0x4000 /FPa /Gs /Zl /Oalt <your file>
This will produce the .OBJ for the .C program. Now what I do is make it
into a LIB by using the MicroSoft LIB.EXE program.
Example: LIB AEDIAL
Now if AEDIAL.LIB does not exist - it will ask if I want to make it, sure
we do.
Then it asks for an operation.
OPERATION: +aedial.obj
This adds aedial.obj to AEDIAL.LIB
Then it will ask for list file: Either enter a file name or hit enter.
If you look at AEDIAL.LST - this is a list file of the LIB.
Now it asks for an OUTPUT LIB - I just hit enter.
You've made a library of your function - great, but if it calls any other
routines you need to include them. Generally I pull all the additional
routines I need from LLIBCA.LIB.
To see the functions in there do this:
LIB LLIBCA
OPERATION: <hit enter>
list File: LLIBCA.LST
OUTPUT LIB: <hit enter>
this makes a list of all the functions in llibca.lib
now compile your program with any of the following linkers:
TLINK <your file>,,,CLIPPER+EXTEND+<YOUR LIB>
PLINK86 FI <your file> LIB Clipper, Extend, <YOUR LIB>
or
LINK /NOE <your file>,,,CLIPPER+EXTEND+<YOUR LIB>
A list of missing routines will appear. Keep a list of them.
Now find them in the LLIBCA.LST - I use LIST64x program to do this.
Identify the .OBJ they are in so you can extract them from LLIBCA.LIB.
Lets say we need int86.obj. First we have to get it out of LLIBCA.LIB
so,
LIB LLIBCA
Operations: *int86.obj
list file: <enter>
output lib: <enter>
LIB <YOUR LIB>
Operations: +int86.obj
list file: <enter>
output lib: <enter>
now int86.obj is in your library. Continue to find the missing resources
you need - copy them from their original LIB (* command) and then add them
to your LIB. In the end you will have a stand-alone LIB.
Only a little confusing, actually not bad once you get the hang of it. If
you don't care about the size of the LIB you could simply add LLIBCA.LIB to
your LIB by:
LIB <YOUR LIB>
operations: +llibca.lib
list file: <enter>
output lib: <enter>
Messy though, makes large LIBS
Ok enough about 'C' and clipper LIB, etc. Lets see what functions AEDIAL
has.
ModemNum(comport), where 0 = COM 1, 1 = COM 2. Default is COM 1
ModemInit(baud), where baud = 110, 300, 1200, 2400, 9600
ModemStr(string), where string = command for AT, i.e.
ModemStr("H0") - HangUp
ModemStr("V1 X7 Q0 F1 E1 &W") - Good initialization string
ModemDial(string), where the string is the phone number, i.e.,
ModemDial("1-508-833-0508")
ModemStat(), returns modem status in verbal mode if V1 command issued
with ModemStr() function. Returns a string
Well I guess I've been long winded enough, play with it, look at the 'C'
source and demo program AECLIPD.PRG. Hopefully this will help you make
some Clipper 'C' UDF's for the public domain. If you do please upload
them to Auto Exec BBS, we're trying to maintain the largest Clipper
file list around. If you do call - let me know how AEDIAL worked for you
or any suggestions on improvement.